package com.lanou3g.myapplication.activity;


import com.android.volley.RequestQueue;
import com.lanou3g.myapplication.activity.singleton.activity.BaseActivity;
import com.lanou3g.myapplication.adapter.RecommendedAdapter;

/**
 * Created by dllo on 16/1/10.
 */
public class VolleyGeson extends BaseActivity {
    private RequestQueue requestQueue;
    private String url = "http://zzd.sm.cn/appservice/api/v1/channel/100?client_os=android&client_version=2.1.0.1&bid=800&m_ch=004&city=0411&sn=ade627ae9c8b3165f8beab83650296fd&content_cnt=20&recoid=2987975311729206682&ftime=1452049562236&method=new&count=20";
    private RecommendedAdapter adapter;

    @Override
    protected int setLayout() {
        return 0;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        requestQueue = Volley.newRequestQueue(this);
//        setContentView(R.layout.activity_main);
//        Log.d("VolleyGeson", "onCreate");
//        StringRequest request = new StringRequest(url, new Response.Listener<String>() {
//
//            @Override
//            public void onResponse(String response) {
//                Log.d("MainActivity", response);
//                Gson gson = new Gson();
//                ResponseEty responseEty = gson.fromJson(response, ResponseEty.class);
//                adapter.addData("5345",0);
//                for (int i = 0; i < 10; i++) {
//                    Log.d("MainActivity", responseEty.getData().getArticle().get(i).getTitle());
//
//                    //Toast.makeText(MainActivity.this, responseEty.getData().getArticle().get(i).getTitle(), Toast.LENGTH_SHORT).show();
//                    //textView.setText(responseEty.getData().getArticle().get(i).getTitle());
//                }
//
//
//            }
//        }, new Response.ErrorListener() {
//            @Override
//            public void onErrorResponse(VolleyError error) {
//
//            }
//        });
//        Log.d("MainActivity", "request:" + request);
//        //将网络请求放入队列(即开始进行网络数据获取)
//        requestQueue.add(request);
//
//    }



}
